home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / uupc 3.1 / (uupc π) / macinit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-27  |  1.5 KB  |  57 lines  |  [TEXT/KAHL]

  1. /*            macinit.c
  2.  
  3.             Portions Copyright © David Platt, 1992, 1991.  All Rights Reserved
  4.             Worldwide.
  5.  
  6. */
  7.  
  8. #ifdef THINK_C
  9. # include "unixlibproto.h"
  10. #endif THINK_C
  11.  
  12. #include "dcp.h"
  13.  
  14. #include    <stdio.h>
  15.  
  16. #include "macinit.proto.h"
  17.  
  18. macinit(void)
  19. {
  20.     WindowPeek theWindow;
  21.     int consoleDriverRefNum;
  22.     DCtlHandle consoleDriverHandle;
  23.     /* standard initialization required by real Mac applications */
  24.     InitGraf(&thePort);
  25.     InitWindows();
  26.     InitFonts();
  27.     FlushEvents(everyEvent,0);
  28.     InitMenus();                /* init menu manager */
  29.     InitDialogs((ProcPtr) 0L);    /* init dialog manager */
  30.     TEInit();                    /* init text edit */
  31.     InitCursor();
  32.     SetApplLimit(GetApplLimit() - MAXPACK * 4); /* room enough for big protocol buffers */
  33.     MaxApplZone();
  34.     OpenResFile("\pUUPC sounds");
  35. /*
  36.     That which follows, makes my skin crawl and my gorge rise.  I
  37.     hate doing things like this.  Ne'ertheless, it seems to be
  38.     necessary to keep the THINK C console driver from eating all
  39.     keyclicks which take place when its window is foremost.  The
  40.     behavior of the driver is appropriate for I/O consoles, but
  41.     is inappropriate for output-only consoles such as the one
  42.     that UUPC uses.
  43. */
  44.     printf("Welcome to uupc!\n\n");
  45.     theWindow = stdout->window;
  46.     consoleDriverRefNum = theWindow->windowKind;
  47.     consoleDriverHandle = GetDCtlEntry(consoleDriverRefNum);
  48.     if (consoleDriverHandle) {
  49.         (**consoleDriverHandle).dCtlEMask &= 0xFFF7; /* turn off key-down event grab */
  50.     }
  51. /*
  52.     Forgive me, for I have sinned.
  53.             dplatt@snulbug.mtview.ca.us
  54. */
  55. }
  56.  
  57.